#ifndef _ENTITYVIEW_H_
#define _ENTITYVIEW_H_

#include "../sdl/SDLSurface.h"
#include "../../GameModel/model/Entity.h"
#include <string>

using namespace std;
using namespace model;
using namespace sdl;

namespace view
{
class EntityView
{
public:
	EntityView(Entity* entity, SDLSurface* parentSurface);
	EntityView(Entity* entity, SDLSurface* parentSurface, int width, int height);
	EntityView(Entity* entity, SDLSurface* parentSurface, SDLSurface* srfc);
	virtual ~EntityView(void);
	virtual void setPosition(double x, double y);
	virtual double getX(void);
	virtual double getY(void);
	virtual double getWidth(void);
	virtual double getHeight(void);
	virtual void paint(void);
	Entity* getEntity(void);
	
	void setPolygonMode    (bool mode) { polygonMode = mode;}
	void setOnlyPolygonMode(bool mode) { onlyPolygonMode = mode;}

	bool isInPolygonMode(void) { return polygonMode;}

protected:
	virtual void init(Entity* entity, SDLSurface* parentSurface);
	virtual void checkAndPaintEntityOnEdge(double rotatedX, double rotatedY);
	virtual void drawPolygon(Entity*);
	Entity* entity;
	SDLSurface* surface;
	SDLSurface* parentSurface;
	double lastDirection;
	bool polygonMode, onlyPolygonMode;
};
};

#endif
